using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace CommandPatternApp
{
    public class CmdFactory
    {
        private TextEditor _editor;

        public CmdFactory(TextEditor editor)
        {
            _editor = editor;
            _editor.CmdFactory = this;
        }

        #region Factory methods
        public OpenFileCmd OpenFileCmd()
        {
            return new OpenFileCmd(_editor, this);
        }

        public SaveFileCmd SaveFileCmd()
        {
            return new SaveFileCmd(_editor, this);
        }

        public UndoCmd UndoCmd(CmdMenuItem undoMenuItem)
        {
            return new UndoCmd(_editor, this, undoMenuItem);
        }

        public CopyCmd CopyCmd()
        {
            return new CopyCmd(_editor, this);
        }

        public CutCmd CutCmd()
        {
            return new CutCmd(_editor, this);
        }

        public PasteCmd PasteCmd()
        {
            return new PasteCmd(_editor, this);
        }
        #endregion
    }
}
